#pragma once
#include "ConductiveLayer.h"
#include "kernel/fePolylineGenerator.h"
#include "fePolylineTriangulation.h"
#include "VertMagnDipole.h"


class VmdEdsCalcTask
{
	ConductiveLayer *Layers;
	int				 NumLayers;


	fePolylineTriangulation RecTris;
	fePolyline<double>  *Generator;
	fePolyline<double>  *Receiver;

	double			   *TimesArray;
	int					TimesCount;
	
	VertMagnDipole		Dipole;
	
private:
	double Integrate(double iF[3], double iX[3]);

public:
	VmdEdsCalcTask();
	bool Init(ConductiveLayer *iLayers, int iNumLayers, fePolyline<double> *iGenerator, fePolyline<double> *iReceiver);
	bool Eds(double iZ, double *iTimes, int iTimesCount, double *oResV);
	~VmdEdsCalcTask();
};
